import Vuex from 'vuex'
import Vue from 'vue'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    token: '',
    authorityList: [],
    curAuthority: [],
    userName: ''
  },
  mutations: {
    setToken (state, token) {
      state.token = token
    },
    setAuth (state, auth) {
      state.authorityList = auth
    },
    setCurAuth (state, auth) {
      state.curAuthority = auth
    },
    setUserName (state, name) {
      state.userName = name
    }
  }
})

export default store
